var oPopup = document.createElement('div'); 
document.body.appendChild(oPopup); 

var oPopBody = oPopup.document.body; 
var strCalendar; 
var cleft; 
var ctop; 

if(dom) { 
    strCalendar = "<img src='' width=0 height=0>"; 
    strCalendar += "<style type='text/css'>"; 
    strCalendar += "td {font-size:12px; font-family:굴림; text-decoration:none; }"; 
    strCalendar += "A:link,A:active,A:visited{text-decoration:none;font-size:12PX;color:#333333;}"; 
    strCalendar += "A:hover {text-decoration:none; color:ff9900}"; 
    strCalendar += "font { font-size: 9pt; }"; 
    strCalendar += ".cnj_close {font-size:8pt;color:#000000; background-color:#EFEFEF; border-width:1; border-color:#808080; border-style:solid;cursor:hand;font-weight:bold;height:16px;width:16px;text-align:center;vertical-align:bottom}"; 
    strCalendar += ".cnj_close2 {font-size:8pt;color:#000000; background-color:#EFEFEF; border-width:1; border-color:#808080; border-style:solid;cursor:hand;font-weight:bold;height:16px;width:16px;text-align:center;vertical-align:bottom}"; 
    strCalendar += ".cnj_input {background-color:rgb(240,240,240);border-width:1pt; height:16pt;cursor:hand;}"; 
    strCalendar += ".cnj_input2 {font-size:8pt;color:#808080; background-color:#EFEFEF; border-width:1; border-color:#808080; border-style:solid;cursor:hand;height:16px;}"; 
    strCalendar += ".cnj_input3 {font-size:8pt;color:#000000; background-color:#FFFFFF; border-width:1; border-color:#C00000; border-style:solid;cursor:hand;height:16px;}"; 
    strCalendar += ".cnj_input4 {font-size:8pt;color:#C00000; background-color:#FFFFFF; border-width:1; border-color:#808080; border-style:solid;cursor:hand;height:16px;}"; 
    strCalendar += ".cnj_td {border-width:1;border-style:solid;border-color:#a0a0a0;}"; 
    strCalendar += "</style>"; 

    strCalendar += "<div id='calendar' style='z-index:+999;position:absolute;;'>"; 
    strCalendar += "<table width='190' class='cnj_td'>"; 
    strCalendar += "    <tr bgcolor='#EEEEEE' height=20>"; 
    strCalendar += "        <td>"; 
    strCalendar += "            <table width='188' border=0>"; 
    strCalendar += "                <tr height=20>"; 
    strCalendar += "                    <td style='padding:0px;'><font color='#ffffff'><B><span id='caption'></span></B></font></td>"; 
    strCalendar += "                    <td align=right><input type='button' value='x' class='cnj_close' title='닫기' onclick='parent.oPopup.hide()' onfocus='this.blur()' onMouseover=\"this.className='cnj_close2'\" onMouseout=\"this.className='cnj_close'\"></td>"; 
    strCalendar += "                </tr>"; 
    strCalendar += "            </table>"; 
    strCalendar += "        </td>"; 
    strCalendar += "    </tr>"; 
    strCalendar += "    <tr height=1>"; 
    strCalendar += "        <td style='padding:3px' bgcolor=#ffffff><span id='content'></span></td>"; 
    strCalendar += "    </tr>"; 
            
    if(showToday==1) { 
        strCalendar += "<tr bgcolor=#f0f0f0 height=20><td style='padding:5px' align=center><span id='lblToday'></span></td></tr>"; 
    } 
            
    strCalendar += "</table>"; 
    strCalendar += "</div>"; 
    strCalendar += "<div id='selectMonth' style='z-index:+999;position:absolute;display:none;'></div> "; 
    strCalendar += "<div id='selectYear' style='z-index:+999;position:absolute;display:none;'></div>"; 
    oPopBody.innerHTML = strCalendar; 
} 

function init() { 
    if(!ns4) { 
        if(!ie) { 
            yearNow += 1900; 
        } 

        crossobj = oPopBody.all.calendar; 
        crossMonthObj = oPopBody.all.selectMonth; 
        crossYearObj = oPopBody.all.selectYear; 
        monthConstructed = false; 
        yearConstructed = false; 

        sHTML1="<input type='button' value='◀' class='cnj_input2' onClick='javascript:parent.movedecMonth()' onfocus='this.blur()' title='이전 달(월)로 이동' " 
        sHTML1+="onMouseover=\"this.className='cnj_input3';window.status='이전 달(월)로 이동'\" onMouseout=\"this.className='cnj_input2';window.status=''\"> </span> " 

        sHTML1+="<input type='button' value='▶'  class='cnj_input2' onClick='javascript:parent.moveincMonth()' onfocus='this.blur()' title='다음 달(월)로 이동' " 
        sHTML1+="onMouseover=\"this.className='cnj_input3';window.status='다음 달(월)로 이동'\"  onMouseout=\"this.className='cnj_input2';window.status=''\"> </span> " 

        sHTML1+="<span id='spanMonth'  class='cnj_input4' onclick='parent.popUpMonth()' title='월 선택' " 
        sHTML1+="onMouseover=\"this.className='cnj_input3';window.status='월 선택'\" onMouseout=\"this.className='cnj_input4';window.status=''\"></span>&nbsp;"; 

        sHTML1+="<span id='spanYear'  class='cnj_input4' onclick='parent.popUpYear()' title='년도 선택' " 
        sHTML1+="onMouseover=\"this.className='cnj_input3';window.status='년도 선택'\" onMouseout=\"this.className='cnj_input4';window.status=''\"></span> "; 

        alert(sHTML1);
        oPopup.document.getElementById("caption").innerHTML = sHTML1; 
        bPageLoaded = true; 
        
        if(showToday==1) { 
            oPopup.document.getElementById("lblToday").innerHTML =    ""+ 
            "<div onmousemove='window.status=\"오늘 날짜로 표시하기\"' onmouseout='window.status=\"\"' title='오늘 날짜로 표시하기' "+ 
            //" style='"+styleAnchor+"' href='javascript:monthSelected=monthNow;yearSelected=yearNow;constructCalendar();' onFocus='this.blur()'>"+ 
            " style='"+styleAnchor+"' onclick='parent.totoday()' onFocus='this.blur()'>"+ 
            "오늘 날짜 :  "+yearNow+"년 "+ 
            ""+monthName[monthNow].substring(0,3)+" "+ 
            ""+dateNow+"일 "+  // 일 
            "</div>"; 
        }        
    } 
} 